cmake_minimum_required(VERSION 3.10.2)
project(service)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -fno-rtti -fvisibility=hidden -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0 -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../mock")
set(KV_STORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../kv_store")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/backup/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/config/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/config/src/model serviceSrc)
aux_source_directory(../framework/directory/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/crypto/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/rdb serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/kvdb serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/matrix/src serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/object serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/common serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/data serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies/general serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies/data_proxy serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies/data_share serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/data_share/contexts serviceSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/permission/src serviceSrc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backup/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/config/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/crypto/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap/include)
include_directories(../framework/directory/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/permission/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/matrix/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/data)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/strategies/data_proxy)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/contexts)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/data_share/gaussdb_rd/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rdb)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/kvdb)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../framework/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/log)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/account)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/autils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/broadcaster)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/communicator)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/dfx)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/log)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/permission)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/security)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../adapter/include/utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../app/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../relational_store/interfaces/inner_api/rdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../relational_store/interfaces/inner_api/rdb_data_share_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../relational_store/interfaces/inner_api/rdb_bms_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_share/interfaces/inner_api/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_share/interfaces/inner_api/provider/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_share/interfaces/inner_api/consumer/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_share/frameworks/native/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_share/frameworks/native/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../data_object/frameworks/innerkitsimpl/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../utils_native/safwk/native/include)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)
include(${KV_STORE_DIR}/interfaces/CMakeLists.txt OPTIONAL)
set(links secure mock kvdb svcFwk adapter data_share document_ut)
set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/../../../")
add_library(service SHARED ${serviceSrc})
target_link_libraries(service ${links})
